<style>
	.votes_table {
		width:100%; background-color:white; 
	  border-radius: 10px;
	  -moz-border-radius: 10px;
	  -webkit-border-radius: 10px;
		border:solid 1px #e8e8e8;
		border-color:#e8e8e8 #bababa #bababa #e8e8e8;
	}
	.votes_table td {
    padding:3px;
  } 
</style>

<% unless lang.recently_updated_votes.empty? %>
	<div style="padding-top:10px; font-size:14px; border-bottom:1px solid #ccc; margin-bottom:5px;">
    <div style="<%=tr8n_style_attribute_tag('float', 'right')%>; font-size:12px;">
       <%=link_to(tra("view all"), :controller => "/tr8n/translations", :action => :index, :with_translations=>:with, :submitted_by=>:me, :locale => lang.locale)%>
    </div>

    <%=tr8n_toggler_tag("votes_content_#{lang.id}", "", false)%>
	  <%=tra("Recent Translation Votes", "Dashboard section header")%>
		<span style="color:#ccc; font-size:12px;"><%=tra("last {count}", nil, :count => 5)%></span>
	</div>
	
	<div id="votes_content_<%=lang.id%>" style="display:none" class="votes_table">
		<div style="margin:10px">
		<table>
		  <tr style="border-bottom:1px solid #ccc;">
		    <td class="topic_header" style="width:200px;"><%=tra("Voter")%></td>
        <td class="topic_header" style="width:25px;text-align:right;padding-right:15px;"><%=tra("Vote")%></td>
        <td class="topic_header" style="width:80px;text-align:right;padding-right:15px;"><%=tra("Total Rank")%></td>
        <td class="topic_header" style=""><%=tra("Translation")%></td>
		  </tr>  
		
		  <% lang.recently_updated_votes.each do |vote| %>
			  <% translation = vote.translation %> 
		    <% style = "border-bottom:1px dotted #ccc;" unless lang.recently_updated_votes.last == vote %>
		    <tr style="<%=style%>">

						<td style="text-align:left; vertical-align:top; padding-top:3px;">
						  <table>
						    <tr>
						      <td style="vertical-align:top;padding-right:2px;">
						        <%=tr8n_user_mugshot_tag(vote.translator, :linked => true)%>
						      </td>
						      <td style="vertical-align:top">
						        <%=tr8n_user_tag(vote.translator, :linked => true)%>
						        <div style="color:grey;">
						            <%=translation.created_at.trl(:date_time) %>
						        </div>
						        <%=tr8n_translator_rank_tag(vote.translator)%>
						      </td>
						    </tr>
						  </table>
						</td>
						
            <td style="text-align:right; vertical-align:top; padding-top:3px;padding-right:15px;">
                <%= vote.vote %> 
            </td>  
            
            <td style="text-align:right; vertical-align:top; padding-top:3px;padding-right:15px;">
                <%= translation.rank_label %> 
            </td>
						
            <td style="text-align:left; vertical-align:top; padding-top:3px;">
				      <span title="<%=trla('Translation for:') %> <%=translation.key.label%>">
				        <%= translation.label %> 
				      </span>
              
              <% if translation.context %>
                <div style="font-size: 11px; color: grey; padding-top:3px;">
                  <%=tra('Context:', 'Translation context rule header')%> <%= translation.context %>  
                </div>
              <% end %>
							
             <%= render :partial => "/tr8n/translations/original_phrase", :locals => {:translation => translation} %>
		    </tr>
		  <% end %>
		</table>
		</div>
	</div>	
<% end %>	